#!/bin/bash
# script name: 日志清理脚本
# author: subushi
# update date: 2025.07.29

# 日志目录列表
LOG_DIRS=(
    "/data/publish/algo3/right/logs/dataCal"
    "/data/publish/algo3/right/logs/dataPre"
    "/data/publish/algo3/left/logs/dataCal"
    "/data/publish/algo3/left/logs/dataPre"
)

# 静默清理
for dir in "${LOG_DIRS[@]}"; do
    [ -d "$dir" ] && find "$dir" -maxdepth 1 -type f -name "*.log" -exec truncate -s 0 {} \; -printf "[%TY-%Tm-%Td] Cleared: %p\n" >> /opt/clear/clean.log
done